package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.business.legaldocuments;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.business.legaldocuments.LegaldocumentsService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 合法性文件控制器
 */
@Action
@RequestMapping(value="business/legaldocuments")
public class LegaldocumentsController extends BaseController {
    @Resource
    public LegaldocumentsService legaldocumentsService;

    /**
     * 合法性文件列表
     * @param
     * page	第几页
     * limit	每页多少条
     * businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * type	名称id:对应字典表数据
     * createyear	创建年份
     * @return
     */
    @At(value = "legaldocumentsListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity legaldocumentsListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return legaldocumentsService.legaldocumentsListPage(jsonParam);
    }

    /**
     * 合法性文件详情
     * @param  id	合法性文件的id
     * @return
     */
    @At(value = "legaldocumentsDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity legaldocumentsDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return legaldocumentsService.legaldocumentsDetail(jsonParam);
    }

    /**
     * 合法性文件新增
     * @param
     * remarks	备注
     * type	名称id:对应字典表数据
     * fileName	附件名称
     * filePath	附件路径
     * @return
     */
    @At(value = "legaldocumentsAdd", method = RequestMethod.POST)
    public RespEntity legaldocumentsAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return legaldocumentsService.legaldocumentsAdd(jsonParam);
    }

    /**
     * 合法性文件修改
     * @param
     * remarks	备注
     * type	名称id:对应字典表数据
     * fileName	附件名称
     * id	合法性文件id
     * filePath	附件路径
     * @return
     */
    @At(value = "legaldocumentsUpdate", method = RequestMethod.POST, param = { "id" })
    public RespEntity legaldocumentsUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return legaldocumentsService.legaldocumentsUpdate(jsonParam);
    }

    /**
     * 合法性文件删除
     * @param   id	合法性文件的id
     * @return
     */
    @At(value = "legaldocumentsDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity legaldocumentsDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return legaldocumentsService.legaldocumentsDelete(jsonParam);
    }






   
}